﻿cmake_minimum_required(VERSION 3.16)

project(NodeEditor LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (MSVC)
    add_compile_options(/utf-8)
endif()

list(APPEND CMAKE_PREFIX_PATH "D:/WorkApp/Qt/5.15.2/msvc2019_64")

find_package(QT NAMES Qt6 Qt5 REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets)

add_executable(NodeEditor
    main.cpp
#    ConsoleApplication.hpp
#    ConsoleApplication.cpp

    MainWin.ui MainWin.hpp MainWin.cpp

    NodeEditor/SceneViewer.hpp
    NodeEditor/SceneViewer.cpp

    NodeEditor/Scene.hpp
    NodeEditor/Scene.cpp

)
target_link_libraries(NodeEditor
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Widgets
)

include(GNUInstallDirs)
install(TARGETS NodeEditor
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
